package com.github.wxiaoqi.security.biz.api;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.wxiaoqi.security.biz.biz.BhIndustryBiz;
import com.github.wxiaoqi.security.common.msg.ResponseCode;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Controller
@RequestMapping("bhIndustry")
public class BhIndustryAction {
	
	@Autowired
	private BhIndustryBiz bhIndustryBiz;
	
	@RequestMapping(value = "/queryAllIndustry", method = RequestMethod.POST)
	@ResponseBody
	public Map<String, Object> queryAllIndustry(){
		Map<String, Object> result = new HashMap<String, Object>();
		try {
			List<Map<String, Object>> list = bhIndustryBiz.queryAll();
			result.put("code", ResponseCode.OK.getCode());
			result.put("sucess", true);
			result.put("msg", ResponseCode.OK.getMessage());
			result.put("body", list);
			Integer a = 0;
		} catch (Exception e) {
			e.printStackTrace();
			result.put("code", ResponseCode.ABNORMAL_FIELDS.getCode());
			result.put("msg", ResponseCode.ABNORMAL_FIELDS.getMessage());
			result.put("sucess", false);
			result.put("body", null);
		}
		log.info("查询全部行业结束{}", result);
		return result;
	}
}
